package cn.yzgy.yzgyoa.ucenter.service.impl;

import cn.yzgy.yzgyoa.ucenter.entity.SysUserRole;
import cn.yzgy.yzgyoa.ucenter.mapper.SysUserRoleMapper;
import cn.yzgy.yzgyoa.ucenter.service.ISysUserRoleService;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 用户-角色对应关系表 服务实现类
 * </p>
 *
 * @author Yqsen
 * @since 2019-12-17
 */
@Service
public class SysUserRoleServiceImpl extends ServiceImpl<SysUserRoleMapper, SysUserRole> implements ISysUserRoleService {

    @Override
    public int addSysUserRole(SysUserRole sysUserRole) {
        return baseMapper.insert(sysUserRole);
    }

    @Override
    public int delSysUserRole(List<String> userId) {
        UpdateWrapper<SysUserRole> wrapper=new UpdateWrapper<>();
        wrapper.in(true,"uid",userId);
        return baseMapper.delete(wrapper);
    }
}
